home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 8 / Amoszine 8 (Disk 2 of 3).adf / Powerbobs.lha / powerbobsv1.0 / examples / Add_Array_vs_Padd_Array.asc next >
Text File  |  1992-09-02  |  623b  |  37 lines

  1. 'This example shows the use of the Padd command. 
  2. 'Beware...if more than 100 is entered, be sure to have a cup of tea.   
  3. '
  4. 'Two array's containing 1001 elements (0 -> 1000) are first Dimensioned. 
  5. '
  6. 'Enter 0 (zero) to stop the speed test.
  7. '
  8. Set Buffer 12
  9. Dim X(1000),Y(1000),Z(1000)
  10. Do 
  11. Input "Give range, max 1000 : ";_MAX
  12. '
  13. If _MAX=0 Then End 
  14. '
  15. T=Timer
  16. For I=1 To 1000
  17.    For K=0 To _MAX
  18.       Add X(K),2
  19.    Next 
  20. Next 
  21. '
  22. 'Display the ellapsed time in Vbl's
  23. '
  24. Print Timer-T
  25. '
  26. ADRESS_X=Varptr(X(0))
  27. T=Timer
  28. For I=1 To 1000
  29.    Padd ADRESS_X,2,0 To _MAX
  30. Next 
  31. '
  32. 'Display the ellapsed time in Vbl's
  33. '
  34. Print Timer-T
  35. '
  36. Loop 
  37.